{extend name="public:base" /}

{block name="css"}
<link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css"/>
<link rel="stylesheet" type="text/css" href="__ADMIN__/css/style.css">
{/block}

{block name="content"}

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <form method="post">
                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">单位名称</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" value="{$info.company_name}" readonly>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">项目名称</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" value="{$info.project_id|getProjectName}" readonly>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">盖章资料</label>
                                <div class="col-sm-3">
                                    {volist name=":doFiles($info.file_ids)" id="v"}
                                    <a style="color: #007bff" href="{$v.path}">{$v.name}</a><br>
                                    {/volist}
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">发票</label>
                                <div class="col-sm-3">
                                    {volist name="info.invoice" id="v"}
                                    <a style="color: #007bff" href="{$v.path}" download="{$v.name}">{$v.name}</a><br>
                                    {/volist}
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        {if $info.status == 1 || $info.status == -1}
                        <div class="box-item">
                            <div class="form-group row layui-form">
                                <label class="col-lg-1 col-form-label">审核</label>
                                <div class="col-lg-3">
                                    <input type="radio" lay-filter="status" name="status" value="2" title="审核通过" {$info.status !=-1 ? 'checked' : ''}>
                                    <input type="radio" lay-filter="status" name="status" value="-1" title="审核不通过" {$info.status== -1 ? 'checked' : ''}>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>
                        {/if}

                        <div class="box-item refuse_box" style="display: none">
                            <div class="form-group row">
                                <label class="col-sm-1 col-form-label">不通过原因</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control refuse_reason" name="refuse_reason" value="{$info.refuse_reason}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <input type="hidden" name="id" value="{$info['id']}">

                        <div class="form-group row">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button type="button" class="btn btn-w-m btn-default back-page">返回</button>
                                {if $info.status == 1 || $info.status == -1}<button type="button" class="btn btn-w-m btn-primary ajax-post">确认审核</button>{/if}
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name='js'}
<script src="__STATIC__/layui/layui.js"></script>
<script type="text/javascript" src="__PLUG__/kindeditor/kindeditor-all.js"></script>
<script>
    var status  = "{$info.status}";
    if(status == -1) $('.refuse_box').show();

    layui.use(function () {
        var form = layui.form;
        var layer = layui.layer;

        form.on('radio(status)', function (data) {
            var status = data.value;
            if (status == 2) {
                $('.refuse_box').hide();
                $('.refuse_reason').val('');
            } else {
                $('.refuse_box').show();
            }
        })
    })

</script>
{/block}
